<!DOCTYPE html>
<html>
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="keywords" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <title>RhaPHP 二哈微信平台管理系统</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link href="__STATIC__/admin/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {CSS href="__STATIC__/admin/css/admin_base.css" /}
    {js href='__STATIC__/jquery/jquery-1.11.0.min.js' /}
    {js href='__STATIC__/layui/layui.js' /}
    {CSS href="__STATIC__/layui/css/layui.css" /}
    {CSS href="__STATIC__/icon/icon.css" /}
    {block name="jscss"}{/block}
    <style>
        {if $setScreen ==1}
        .container_body, .wrap{width: 100%;}
        .sidebar{float:left;width: 12%;}
        .content{float: left;width: 87%;}
        .main-logo{margin-left: 5px;}
        .menu dl dt .type-ico{margin-left: 5%}
        .menu dl dd a{padding-left: 22%;}
        #addon_menu .item-icon{margin-left: 5%;}
        .addon_menu-left-nav-a .item-icon{left: 0;}
        .addon_menu-left-nav-a {padding-left: 23%;}
        {/if}
    </style>
</head>
<body class="trade-order">
<div class="topbar" id="gotop">
    <div class="wrap">
        <ul>
            <li>你好，<a class="name" href="" id="username">{$admin.admin_name}</a>
                {notempty name="mpInfo"}
                <span class="quit">当前公众号：<a href="{:url('mp/index/index',['mid'=>$mpInfo['id']])}">{$mpInfo.name}</a><i style="font-size: 9px; margin-left: 5px;">{:getMpType($mpInfo['type'])}</i>
                    {eq name="$mpInfo.valid_status" value="1"}
                    <i style="font-size: 9px; margin-left: 5px;">已接入</i>
                    {else/}
                    <i style="font-size: 9px; margin-left: 5px; color: red">未接入</i>
                    {/eq}
                </span>
                <a class="quit" href="{:url('mp/index/mplist')}">切换公众号</a>
                <a href="{:url('mp/Message/messagelist')}"><i class="layui-icon">&#xe645;</i>用户消息<span class="num-feed rhaphp-msg-user show" style="display: none;">0</span></a>
                {/notempty}

                <a href="javascript:;" onclick="cacheClear()"><i class="layui-icon">&#xe640;</i>清空缓存</a>
                <a href="javascript:;" onclick="setScreen()"><i style="font-size: 14px;" class="rha-icon">&#xe879;</i>宽屏</a>
                <a class="quit" href="{:url('admin/Login/out')}"><i class="rha-icon">&#xe696;</i>退出</a>
            </li>
        </ul>
    </div>
</div>
<div class="header">
    <div class="wrap">
        <div class="logo">
            <h1 class="main-logo"><a href="{:url('mp/mp/index')}">RhaPHP</a></h1>
            <div class="sub-logo"></div>
        </div>
        <div class="nav">
            <ul>
                {volist name="t_menu" id="t"}
                <li class="{eq name="topNode" value="$t['url']"}selected{/eq}"><a href="{:url($t['url'])}">{$t.name}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div class="container_body wrap">
    <div class="sidebar">
        <div class="menu">
            {volist name="menu" id="t"}
            <dl>
                <dt><i class="type-ico ico-trade rha-icon {eq name="t['shows']" value="1"}{/eq}">{$t.icon|raw}</i>{$t.name}</dt>
                {volist name="$t['child']" id="c"}
                <dd class="{eq name="c['shows']" value="1"}selected{/eq}"><a href="{:url($c['url'])}">{$c.name}</a></dd>
                {/volist}
            </dl>
            {/volist}
            {block name="leftMenu"}{/block}
            <dl>
                {php} if(!isset($menu_app))$menu_app=null;{/php}
                {if condition="$menu_app neq '' "}<dt><i class="type-ico ico-trade rha-icon">&#xe6f0;</i>{$menu_app_title}</dt>{/if}
                {volist name="menu_app" id="v"}
                <dd class=""><a href="{:url('mp/App/index',['name'=>$v.addon,'type'=>'news','mid'=>$mid])}">{$v.name}</a></dd>
                {/volist}
            </dl>
        </div>
    </div>
    <div class="content" id="tradeSearchBd">
        {if condition="isset($menu_tile) OR $menu_title neq ''"}
        <div class="content-hd">
            <h2>{$menu_title}{block name="nav_title"}{/block}</h2>
        </div>
        {/if}
        {block name="body"}主内容{/block}
    </div>
</div>
<div class="footer">
    <div class="wrap">
        <!--请遵守安装使用协议，未经允许不得删除或者屏蔽有关RhaPHP字样与版权-->
        <a href="https://www.rhaphp.com" target="_blank">官方社区</a>
        <i class="vs">|</i>
        Powered By RhaPHP{$copy.version} 二哈系统 Copyright © {:date('Y')} All Rights Reserved.
    </div>
</div>
</body>
<script>
    layui.use('element', function(){
        var element = layui.element;
    });
    function getMaterial(paramName,type){
        layer.open({
            type: 2,
            title: '选择素材',
            shadeClose: true,
            shade: 0.8,
            area: ['750px', '480px'],
            content: '{:url("mp/Material/getMeterial","","")}/type/'+type+'/param/'+paramName //iframe的url
        });
    }
    function controllerByVal(value,paramName,type) {
        
        $('.form_'+paramName).attr('src',value);
        $("input[name="+paramName+"]").val(value);
    }
    $(function () {
       //  setInterval(getMsgTotal,20000);
        function getMsgTotal() {
            $.get("{:url('mp/Message/getMsgStatusTotal')}",{},function (res) {
                if(res.msgTotal==0){
                    //TODO
                }else{
                    $('.rhaphp-msg-user').show();
                    $('.rhaphp-msg-user').text(res.msgTotal);
                }

            })
        }
    })
    var layer
    layui.use('layer', function(){
        layer = layui.layer;
    });
    function cacheClear() {
        var index =layer.load(1)
        $.post("{:url('admin/system/cacheClear')}",function (res) {
            layer.close(index);
            layer.alert(res.msg);
        })
    }
    function setScreen() {
        var index =layer.load(1)
        $.post("{:url('admin/system/setScreen')}",function (res) {
            layer.close(index);
            window.location.reload();
        })
    }
</script>
</html>